import request from '@/utils/request'
/**
 * 获取 -分页查询角色列表
 *
 */
export const getRoleListByPageService = (query) => {
  return request.get('/sys/role', {
    params: query
  })
}

/**
 * 新增角色
 */
export const addRoleService = (data) => request.post('/sys/role', data)
/**
 * 删除角色
 */
export const deleteRoleService = (id) => request.delete(`sys/role//${id}`)
/**
 * 修改角色
 */
export const updateRoleService = (data) => {
  return request.put('/sys/role/' + data.id, data)
}
/**
 * 获取角色详情
 */
export const getRoleDetailService = (id) => {
  return request.get('/sys/role/' + id)
}
/**
 * 分配角色权限
 */
export const assignPermissionService = (data) => {
  return request.put('/sys/role/assignPrem', data)
}
